WPS Office.apk(点击下载) / stw.java


package defpackage;

import java.io.File;

/* renamed from: stw  reason: default package */
public final class stw {
    private static suu usj = suu.fgZ();
    private static String utg = "https://note-api.wps.cn";

    public static void SM(String str) {
        if (str.endsWith("/")) {
            str = str.substring(0, str.length() - 1);
        }
        utg = str;
    }

    public static File a(String str, String str2, File file, stv stv) throws Exception, sul {
        stl.fgO();
        try {
            return stl.SH(str).a(str2, file, stv);
        } catch (Exception e) {
            stl.fgO();
            return stl.SI(str).a(str2, file, stv);
        }
    }

    public static ssv<sty> fgR() throws sul {
        String str = utg + "/skin/resources/list";
        try {
            sum a = suj.a(str, new suk().n("prefix", "previews/default"));
            sup SS = sui.SS(a.bSY);
            if (a.isSuccessful()) {
                return new ssv<>(a.code, SS, sty.k(SS));
            }
            ssv<sty> ssv = new ssv<>(a.code, SS, null);
            usj.a(str, "", ssv.errorCode, ssv.gCV, a);
            return ssv;
        } catch (Throwable th) {
            usj.a(str, "", th, null);
            throw new sul(th);
        }
    }

    public static ssv<sty> fgS() throws sul {
        String str = utg + "/skin/resources/list";
        try {
            sum a = suj.a(str, new suk().n("prefix", "thumbnail"));
            sup SS = sui.SS(a.bSY);
            if (a.isSuccessful()) {
                return new ssv<>(a.code, SS, sty.k(SS));
            }
            ssv<sty> ssv = new ssv<>(a.code, SS, null);
            usj.a(str, "", ssv.errorCode, ssv.gCV, a);
            return ssv;
        } catch (Throwable th) {
            usj.a(str, "", th, null);
            throw new sul(th);
        }
    }
}